/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package asis;

import java.util.ArrayList;
import java.util.HashMap;
import skyproc.FormID;
import skyproc.ModListing;
import skyproc.PERK;

/**
 *
 * @author pc tech
 */
public class Perk {

    private PERK perk;
    private int numConditions;
    private FormID nextPerk = null;
    private ArrayList<Integer> actorValues = new ArrayList<>(0);
    private ArrayList<Float> compValues = new ArrayList<>(0);
    private ArrayList<Integer> perkType = new ArrayList<>(0);

    /**
     * @param args
     */
    public Perk(PERK newperk, int actorValue, float compValue) {

        this.perk = newperk;
        this.actorValues.add(actorValue);
        if ((actorValue >= 6) && (actorValue <= 23)) {
            perkType.add(actorValue);
        } else {
            perkType.add(-1);
        }
        this.compValues.add(compValue);
        numConditions = 1;
    }

    public Perk(PERK newperk, int actorValue, float compValue, FormID nextPerkForm) {

        this.perk = newperk;
        this.actorValues.add(actorValue);
        if ((actorValue >= 6) && (actorValue <= 23)) {
            perkType.add(actorValue);
        } else {
            perkType.add(-1);
        }
        this.compValues.add(compValue);
        this.nextPerk = nextPerkForm;
        numConditions = 1;
        
    }

    public void addConditional(int actorValue, float compValue) {
        this.actorValues.add(actorValue);
        if ((actorValue >= 6) && (actorValue <= 23)) {
            perkType.add(actorValue);
        } else {
            perkType.add(-1);
        }
        this.compValues.add(compValue);
        numConditions++;
    }

    public int getPerkType(int index) {
        return perkType.get(index);
    }

    public PERK getPerk() {
        return perk;
    }

    public FormID getPerkForm() {
        return perk.getForm();
    }

    public float getPerkLevel(int index) {
        return compValues.get(index);
    }

    public String getEDID() {
        return perk.getEDID();
    }

    public ModListing getModMaster() {
        return perk.getFormMaster();
    }

    public int getRank() {
        return 1;
    }

    public int getNumConditionals() {
        return numConditions;
    }

    public FormID getNextPerk() {
        return nextPerk;
    }
}
